package com.mc.mcgoweb.handle;

import com.mc.common.base.BaseResponse;
import com.mc.common.base.ResultUtil;
import com.mc.common.exception.RedisException;
import com.mc.common.redis.Impl.RedisCache;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 测试全局异常拦截器
 */
@SpringBootApplication
@Controller
@RequestMapping("/mc")
@Slf4j
public class TestHandleController {

    @GetMapping("/testHandle")
    @ResponseBody
    public BaseResponse handle() throws RedisException {
        if (1==1) throw  new RedisException("测试全局异常0");
        return ResultUtil.getSuccessResultData();
    }


}